var a,
  e = require("../../res/www.a9a.cn.js"),
  t = getApp();
Page({
  data: { miao: 0 },
  onLoad: function (i) {
    var n = this;
    t.ajax({
      url: "loading.php",
      data: { submitok: "getvar" },
      success: function (t) {
        1 == t.flag
          ? ((a = t.loading.pagePath),
            e.empty(a) && (a = "/pages/index/index4"),
            n.setData({
              loading: t.loading,
              miao: t.loading.miao,
              pagePath: a,
              btntext: t.loading.btntext,
              path_s: t.loading.path_s,
              path_s_url: t.loading.path_s_url,
              color: t.color,
              rgbcolor: e.c16_rgb(t.color),
            }),
            0 == t.loading.miao
              ? wx.switchTab({ url: "/pages/index/index4" })
              : (n.time = setInterval(function () {
                  n.setData({ miao: n.data.miao - 1 }),
                    0 == n.data.miao &&
                      (clearInterval(n.time),
                      "/pages/index/index4" == a ||
                      "/pages/user/user" == a ||
                      "/pages/hn/hn" == a
                        ? wx.switchTab({ url: a })
                        : wx.reLaunch({ url: a }));
                }, 1e3)))
          : wx.showToast({ title: t.msg, icon: "none", mask: !0 });
      },
    });
  },
  cliadv: function () {
    clearInterval(this.time),
      "/pages/index/index4" == a ||
      "/pages/user/user" == a ||
      "/pages/hn/hn" == a
        ? wx.switchTab({ url: a })
        : wx.reLaunch({ url: a });
  },
  onShareAppMessage: function () {
    return {
      imageUrl: this.data.loading.share.imgurl,
      title: this.data.loading.share.title,
      path: "/pages/loading/loading",
    };
  },
  onShareTimeline: function () {
    return {
      imageUrl: this.data.loading.share.imgurl,
      title: this.data.loading.share.title,
      query: "",
      path: "/pages/loading/loading",
    };
  },
});
